#pragma once

#include <cstdint>
#include <string>
#include <functional>

// Forward declarations
class CPollerObject;
class CCSocketHandler;
class ICC_Decoder;
class ICC_TCP_Handler;
class ICC_Timer_Handler;
class TimerOutEvent;
class CCTimer;

// Basic types and enums
enum connType {
    CONN_TYPE_ACCEPT = 0,
    CONN_TYPE_CONNECT = 1
};

// Socket event types
enum {
    SOCKET_READ = 1,
    SOCKET_WRITE = 2,
    SOCKET_ERROR = 4
};

// Timer event ID
enum {
    HTTP_KEEP_ALIVE_TIME_ID = 100,
    HTTP_HEART_BEATT_TIME_ID = 101,
    HTTP_HEART_BEATT_TIME_CHECK = 30,
    HTTP_KEEP_ALIVE_MAX_TIMES = 100,
    HTTP_KEEP_ALIVE_TIMEOUT_SEC = 60,
    HTTP_KEEP_ALIVE_OPEN = true
};

// Error codes
enum {
    ERR_SUCCESS = 0,
    ERR_SOCKET = -1,
    ERR_BIND = -2,
    ERR_LISTEN = -3,
    ERR_ACCEPT = -4,
    ERR_POLL = -5,
    ERR_TIMEOUT = -6,
    ERR_MEMORY = -7
};

// Poller events
#define POLLIN  0x001
#define POLLPRI 0x002
#define POLLOUT 0x004
#define POLLERR 0x008
#define POLLHUP 0x010
#define POLLNVAL 0x020

// Data protocol types
enum DataProtocolType {
    PROTOCOL_UNKNOWN = 0,
    PROTOCOL_HTTP = 1,
    PROTOCOL_TCP = 2,
    PROTOCOL_UDP = 3
};

// Legacy constants for compatibility
#define DATA_PROTOCOL_HTTP PROTOCOL_HTTP